package fr.emn.integration.synthese.controle.EleveDialog;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;

import fr.emn.integration.synthese.abstraction.Cours;

public class ControlJComboEleveDialog implements ItemListener {
	
	private JComboBox choixModule;
	private JComboBox choixGroupe;
	private Cours modele;


	public ControlJComboEleveDialog (JComboBox choixModule, JComboBox choixGroupe, Cours modele) {
		super();
		this.choixModule=choixModule;
		this.modele=modele;
		this.choixGroupe=choixGroupe;
	}


	@Override
	public void itemStateChanged(ItemEvent arg0) {
		// TODO Auto-generated method stub
		this.choixGroupe.setModel(new DefaultComboBoxModel(modele.getGroupeNames(modele.findModuleId((String)choixModule.getSelectedItem()))));
		this.choixGroupe.repaint();
	}


	




}
